#ifndef __SPIBUS_H__
#define __SPIBUS_H__

#include "cpu_io.h"


//External Functions

/**********************
	SPI
**********************/
#define SPI_SCKIDLE_LOW			0
#define SPI_SCKIDLE_HIGH		1
	
#define SPI_LATCH_1EDGE			0
#define SPI_LATCH_2EDGE			1

int gt_spi_init(U8 nID);
int gt_spi_config(U8 uID,U32 speed,U8 sckmode,U8 latchmode,U8 ucMode);
U8 gt_spi_Transmit(U8 uID, U8 nData); 
U8 gt_spi_send(U8 uID, const void *psendbuf,int nLen);
void gt_spi_it_open(U8 uID);






U8 gt_spibus_config(U8 uID,U32 speed,U8 sckmode,U8 latchmode);
U8 gt_spibus_send(U8 uID, U8 *pData, U8 nLen);




#endif

